using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Report
{
	public class CsvTxtOperator
	{
		public static void SaveToCsv(string file, List<List<string>> list)
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < list.Count; i++)
			{
				List<string> list2 = list[i];
				StringBuilder stringBuilder2 = new StringBuilder();
				foreach (string item in list2)
				{
					stringBuilder2.Append(",");
					stringBuilder2.Append(item);
				}
				if (stringBuilder2.Length > 0)
				{
					stringBuilder2.Remove(0, 1);
				}
				stringBuilder.AppendLine(stringBuilder2.ToString());
			}
			File.WriteAllText(file, stringBuilder.ToString(), Encoding.UTF8);
		}
	}
}
